<%@ page import="java.util.List" %>
<%@ page import="java.util.HashMap" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <title>成语接龙(字)</title>
    <jsp:useBean id="wordLink" class="gamer.Bean.LinkBean" scope="session"/>
    <jsp:useBean id="user" class="gamer.Bean.User" scope="session"/>
    <link rel="stylesheet" href="../../css/all.css">
</head>
<body class="container">
<div>
    <div class="header">
        <img class="logo-img" src="../../img/logo.png" alt="logo">
        <div class="menu-div">
            <ul>
                <li><a href="../../index.jsp">首页</a></li>
                <li style="background-color: #BBB"><a href="gameMenu.jsp">游戏菜单</a></li>
                <%
                    if (user.getUser() == null)
                        out.print("<li><a href=\"../user/login.jsp\">登录</a></li>");
                    else
                        out.print("<li><a href=\"../user/userInfo.jsp\">用户中心</a></li>");
                %>
            </ul>
        </div>
    </div>
    <div class="main-div">
        <div class="from-div">
            <form action="../../../word" method="post">
                <label><b>成语接龙汉字版当前得分：<span><%=wordLink.getIdiomLink().size()*50%></span></b></label>
                <label>
                    <input type="text" name="idiom">
                </label>
                <input type="submit" value="提交">
            </form>
        </div>
        <div class="from-div">
            <%
                List<HashMap<String, String>> link = wordLink.getIdiomLink();
                int n = link.size();
                for (int i = n - 1; i >= 0&&i>=n-6; i--)
                    out.print((i == n - 1 ? "<table><tr><th>序号</th><th>成语</th></tr>" : "")
                            + "<tr><td>" + (i + 1) + "</td><td>" + link.get(i).get("idiom")
                            + "</td></tr>" + (i == 0 ? "</table>" : ""));
            %>
        </div>
    </div>
</div>
</body>
</html>
